home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 001_015 / 002c / Text
Encoding:
Text File  |  1994-03-15  |  8.8 KB  |  280 lines

  1. -----------------------------------------------------------------------------
  2. 16th January 1993
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 002
  6. Issue: 1
  7. Author:
  8. -----------------------------------------------------------------------------
  9.  
  10. Using the Olivetti JP101 Printer
  11.  
  12. -----------------------------------------------------------------------------
  13. Applicable Hardware: Electron
  14.                      BBC B
  15.                      BBC B+
  16.                      BBC Master 128
  17.                      Master Compact
  18.  
  19. Related Application Notes:
  20.  
  21.  
  22. -----------------------------------------------------------------------------
  23. Copyright (C) Acorn Computers Limited 1992
  24.  
  25. Every effort has been made to ensure that the information in this leaflet is 
  26. true and correct at the time of printing. However, the products described in
  27. this leaflet are subject to continuous development and improvements and
  28. Acorn Computers Limited reserves the right to change its specifications at
  29. any time. Acorn Computers Limited cannot accept liability for any loss or
  30. damage arising from the use of any information or particulars in this
  31. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  32. Limited.
  33. -----------------------------------------------------------------------------
  34. Support Group
  35. Acorn Computers Limited
  36. Fulbourn Road
  37. Cherry Hinton
  38. Cambridge
  39. CB1 4JN                                                   
  40. -----------------------------------------------------------------------------
  41.  
  42. Using the Acorn JP101 Spark Jet Printer
  43.  
  44. Apart from being a remarkably quiet and fast home computer printer, the
  45. JP101 Spark Jet Printer has many special features which are simple to use
  46. and can improve the presentation of your printouts. Among these features are
  47. nine different national character sets, double width printing, double height
  48. printing, and horizontal and vertical tabulation functions.
  49.  
  50. The printer may be controlled from either a program or from the keyboard
  51. using VDU commands, or by typing control characters on the keyboard. For
  52. example, we can turn the printer on or off from the keyboard or from a BASIC
  53. program by typing VDU or VDU3. This may also be done from the keyboard by
  54. typing CTRL-B or CTRL-C, which is easier to type!!
  55.  
  56. When we wish the printer to perform a more complicated task, such as
  57. printing characters double width, or automatically tabulating data as it
  58. prints it out, then a sequence of commands must be sent to the printer to
  59. tell it how it must print any future characters the computer sends it. We
  60. wish to send these characters to the printer only and this may be done using
  61. VDU1 which sends the next character to the printer only.
  62.  
  63. In order that the printer should recognise characters sent to it by the
  64. computer as part of a command sequence rather than as characters to be
  65. printed they are preceded by an ESC character. This has the ASCII code
  66. number 27, so to send the ESC character to the printer only we use the
  67. command VDU1,27.
  68.  
  69. VDU commands may be strung together so we may send sequences of characters
  70. more easily. For example, to tell the printer that we wish it to print any
  71. further characters we send it as double width characters, we must send it
  72. the sequence ESC 3.  To do this we use VDU1,27,1,51. 51 is the ASCII code
  73. for the character 3.
  74.  
  75. For more information about ASCII codes or VDU commands, see your computer's
  76. user guide.  For more information about the operating commands of the JP101
  77. printer, see the printer manual chapter 6.
  78.  
  79. Given below is a summary of the VDU commands you should use to obtain
  80. various effects on the JP101 printer. Note that before sending any VDU
  81. commands to the printer is possible, the printer must be enabled using a
  82. VDU2 (see example programs in 12) and 14) below).
  83.  
  84. 1)  Double Width Characters On
  85.  
  86.       VDU1, 27, 1, 51   This command turns double width printing on until it is turned off again.
  87.  
  88.  
  89. 2)  Double Width Characters Off
  90.  
  91.       VDU1, 27, 1, 52   This command turns off double width printing.
  92.  
  93.  
  94. 3)  Double Height Characters On
  95.  
  96.       VDU1, 27, 1, 39
  97.  
  98. This command turns on double height printing. It may also be used in
  99. conjunction with 1) to obtain double height, double width characters.
  100.  
  101.  
  102. 4)  Double Height Characters Off
  103.  
  104.       VDU1, 27, 1, 37   This command turns off double height printing.
  105.  
  106.  
  107. 5)  Underlining
  108.  
  109.       VDU1, 27, 1, 42, 1, 48  (normal underlining)
  110.       VDU1, 27, 1, 42, 1, 49  (double underlining)
  111.       VDU1, 27, 1, 42, 1, 50  (dotted underlining)
  112.  
  113. These commands turn on the appropriate style of underlining, which remains
  114. in operation until cancelled.
  115.  
  116.  
  117. 6)  Underlining Off
  118.  
  119.       VDU1, 27, 1, 43   Turns underlining off.
  120.  
  121.  
  122. 7)  Horizontal Character Spacing
  123.  
  124.       VDU1, 27, 1, 60  (10 characters per inch)
  125.       VDU1, 27, 1, 61  (12 characters per inch)
  126.       VDU1, 27, 1, 62  (18 characters per inch)
  127.  
  128. These commands select the number of characters printed per inch
  129. horizontally. The default value on power-up or general reset is 10 cpi.
  130.  
  131.  
  132. 8)  Vertical Line Spacing
  133.  
  134.       VDU1, 27, 1, 69  (6 lines per inch)
  135.       VDU1, 27, 1, 70  (8 lines per inch)
  136.  
  137. These commands set the number of line feeds per inch to the chosen value.
  138.  
  139.  
  140. 9)  Variable Vertical Line Spacing
  141.  
  142.       VDU1, 27, 1, 38, 1, n
  143.  
  144. Sets line spacing to a value between 1/12 inch and 9/12 inch, in increments
  145. of 1/12 inch.  The value n is 48+ (the number of increments). For example,
  146. if the desired line spacing was 5/12 inch, then n would be (48+5) = 53, and
  147. the complete command would be VDU1, 27, 1, 38, 1, 53.
  148.  
  149.  
  150. 10) General Reset
  151.  
  152.       VDU1, 27, 1, 48
  153.  
  154. Clears the print buffer, the horizontal and vertical program settings, the
  155. pitch and line spacings, etc.
  156.  
  157.  
  158. 11) Alternative National Character Sets
  159.  
  160.       VDU1, 27, 1, 91, 1, 48, 1, 51, 1, 48  (German)
  161.       VDU1, 27, 1, 91, 1, 48, 1, 52, 1, 48  (Spanish)
  162.       VDU1, 27, 1, 91, 1, 48, 1, 53, 1, 48  (Danish)
  163.       VDU1, 27, 1, 91, 1, 48, 1, 54, 1, 48  (French)
  164.       VDU1, 27, 1, 91, 1, 48, 1, 55, 1, 48  (Italian)
  165.       VDU1, 27, 1, 91, 1, 48, 1, 56, 1, 48  (Swedish/Finnish)
  166.       VDU1, 27, 1, 91, 1, 48, 1, 57, 1, 48  (British)
  167.       VDU1, 27, 1, 91, 1, 48, 1, 58, 1, 48  (USA-ASCII)
  168.       VDU1, 27, 1, 91, 1, 48, 1, 59, 1, 48  (Norwegian)
  169.  
  170. Selects one of the alternative national character sets. The default is that
  171. set on the DIP switches on the PCB. Details of the special characters are
  172. given in the printer manual on page 5.12.
  173.  
  174.  
  175. 12) Programmed Horizontal Tabulation
  176.  
  177.       VDU1, 27, 1, 80
  178.       (Format Information)
  179.       VDU1, 27, 1, 90
  180.  
  181. This is a complicated command to use. The program below demonstrates the use
  182. of this command to print numbers 0 to 100 in a field width of 60 characters
  183. at tab stops of 0, 10, 15, 40, 47 characters.
  184.  
  185. 10  @%+0                        Turn off screen formatting
  186. 20  VDU2                        Turn on output to printer
  187. 30  VDU1, 27, 1, 80             Tell printer horizontal tabulation program
  188. starts here 
  189. 40  PRINT"60;10;15;40;47";      Send format information, line width followed
  190. by positions of tab stops
  191. 50  VDU1, 27, 1, 90             Tell printer horizontal tabulation program
  192. stops here 
  193. 60  Z=0 
  194. 70  REPEAT 
  195. 80  PRINT Z;                    For Z=0 to 100 print Z  
  196. 90  VDU1, 9                     Horizontal tab to next tab stop 
  197. 100  Z=Z+1                      
  198. 110  UNTIL Z-101 120  VDU1, 12  Page eject  
  199. 130  VDU3                       Turn off output to printer
  200.  
  201.  
  202.  
  203. 13) Horizontal Tab
  204.  
  205.       VDU1, 9
  206.  
  207. Automatically inserts enough spaces as needed to reach the next horizontal
  208. tab stop as set by 12) above. If no Horizontal Tabulation Program is set
  209. then one space is inserted.
  210.  
  211.  
  212.  
  213. 14) Programmed Vertical Tabulation
  214.  
  215.       VDU1, 27, 1, 81
  216.       (format information)
  217.       VDU1, 27, 1, 90
  218.  
  219. This is the vertical version of 12) above. See 12) for more information. 
  220. The following program demonstrates printing as programmed vertical tab
  221. stops.
  222.  
  223. 10  @%=0
  224. 20  VDU2
  225. 30  VDU1, 27, 1, 81'
  226. 40  PRINT"60;10;15;40;47";
  227. 50  VDU1, 27, 1, 90
  228. 60  Z=0
  229. 70  REPEAT
  230. 80  PRINT Z;
  231. 90  VDU1, 11
  232. 100  Z=Z+1
  233. 110  UNTIL Z=6
  234. 120  VDU1, 12
  235. 130  VDU3
  236.  
  237.  
  238. 15) Vertical Tab
  239.  
  240.       VDU1,11
  241.  
  242. Prints contents of buffer up to tab code, then performs paper skip to next
  243. vertical tab stop as defined by a Vertical Tabulation Program. If there is
  244. no vertical tab stop defined, then the printer performs one line feed.
  245.  
  246.  
  247. 16) Paper Skip
  248.  
  249.       VDU1, 12          Performs paper feed to first print line of next page.
  250.  
  251.  
  252. 17) Relative Vertical Form Skip
  253.  
  254.       VDU1, 27, 1, 73, 1, i, l, j, l, k  (where i=48+x, j=48+y, k=48+z)
  255.  
  256. Performs a paper skip of xyz line feeds, where xyz is less than 255. For
  257. example to obtain 100 line feeds use  VDU1, 27, 1, 73, 1, 49, 1, 28, 1, 48
  258.  
  259.  
  260. 18) Line Feed
  261.  
  262.       VDU1, 10          Performs a single line feed
  263.  
  264.  
  265.  
  266. 19) Carriage Return
  267.  
  268.       VDU1, 13          Performs a single line feed
  269.  
  270.  
  271. 20) Audible Alarm
  272.  
  273.       VDU1, 7           Activates audible alarm lasting about 300msec.
  274.  
  275.  
  276. 21) Clear Printer Buffer
  277.  
  278.       VDU1, 127 Clears print buffer and resets print head. Does not affect
  279. tab programs etc.
  280.